<?php
namespace app\admin\controller;
use think\Controller;
use think\Db;
class Brand extends Controller{
    //品牌列表
    public function brandlist(){
        $nets = Db::name('brand')->select();
        // dump($nets);
        // exit;
        $this->assign('nets',$nets);
        return $this->fetch();
    }
    //添加品牌
    public function addbrand(){
        return $this->fetch();
    }
    
    public function addbrand1(){
        // $data=input('post.');
        // dump($data);
        // exit;
        $data=[
            'brand'=>input('brand'),
            
        ];
        // dump($data);
        // exit;
        if(Db::name('brand')->insert($data))
        {
        return $this->success('添加成功','brand/brandlist');
        }else
        {
            $this->error('失败，请重新填写');
        }
       
    }
}
